import React, { Component } from 'react';
import {
	StyleSheet, Text, TouchableOpacity
} from "react-native";
import { GLOBAL } from '../../../config/global';
import { style } from '../../../theme/style';
const scale = GLOBAL.SCALE;
export class AddLongBtn extends Component {
	constructor(props) {
		super(props);
	}
	_callBack(str) {
		this.props.callBack(str);
	}
	render() {
		let { text, bottom, colorBg, direction } = this.props;
		return (
			<TouchableOpacity onPress={() => { this._callBack(1) }} style={[styles.addBtnBox, {
				bottom: bottom * scale,
				backgroundColor: colorBg,
			}, direction == 'left' ? styles.left : styles.right]}>
				<Text style={styles.addBtnText}>{text}</Text>
			</TouchableOpacity>
		)
	}
}
const styles = StyleSheet.create({
	addBtnBox: {
		width: 50 * scale,
		height: 50 * scale,
		position: 'absolute',
		bottom: 5 * scale,
		borderRadius: 50 * scale
	},
	addBtnText: {
		lineHeight: 50 * scale,
		color: style.color.white,
		textAlign: 'center',
		fontSize: 13 * scale
	},
	left: {
		left: 12 * scale,
	},
	right: {
		right: 12 * scale,
	}
})